#import "../fragments/deployment_approval_data.fragment.graphql"
#import "~/graphql_shared/fragments/user.fragment.graphql"

query deployment($fullPath: ID!, $iid: ID!) {
  project(fullPath: $fullPath) {
    id
    deployment(iid: $iid) {
      id
      job {
        id
        name
      }
      userPermissions {
        approveDeployment
      }
      pendingApprovalCount
      approvals {
        ...DeploymentApprovalData
      }
      approvalSummary {
        totalRequiredApprovals
        totalPendingApprovalCount
        rules {
          group {
            id
            name
            webUrl
          }
          user {
            ...User
          }
          accessLevel {
            stringValue
          }
          approvedCount
          requiredApprovals
          pendingApprovalCount
          approvals {
            ...DeploymentApprovalData
          }
        }
      }
    }
  }
}
